import {getfloolinedata,tabdata,creatflowdata} from "@/services/api";
import { stat } from "fs";

export default  {
namespace:'flooline',
state:{
     list:[],
     selectdata:[]
},

effects: {
    *fetchList({ payload },{call,put}){
      const response = yield call(getfloolinedata,{payload});
      yield put({
        type: 'getfloodata',
        payload: response,
      });
    },
    *fetchListselect({ payload },{call,put}){
        const response = yield call(tabdata,{payload});
        yield put({
          type: 'getselectdata',
          payload: response,
        });
    },
    *createflow({ payload },{call,put}){
        const response = yield call(creatflowdata,{payload});
        yield put({
          type: 'creat',
          payload: response,
        });
    }
},
  reducers: {
    getfloodata(state, action) {
        return {
          ...state,
          list: action.payload,
        };
      },
      getselectdata(state, action) {
        return {
          ...state,
          selectdata: action.payload,
        };
      },
      creat(state, action) {
        return {
          ...state,
        //   selectdata: action.payload,
        };
      },
    


}
}